// XMLLib version 1
//
// Author
//
//   Thomas Koos (info@muetze1.de)
//   www.muetze1.de
//
// License
//
//   This Source Code Form is subject to the terms of the Mozilla Public
//   License, v. 1.1. If a copy of the MPL was not distributed with this
//   file, You can obtain one at http://mozilla.org/MPL/1.1/.
//
// Description
//
//   Default string adapter - does nothing than passing the given characters unmodified
//   as result.
//
// Revision
//
//  $Id: StrAdapterDefault.pas 18 2014-04-21 21:28:10Z muetze1@gmail.com $
//

Unit StrAdapterDefault;

Interface

{$Z+}  // equal to $Z4 on newer compilers

Uses
  StrAdapterBase;

    //## Default Encoder: nix!
Type
  TDefaultAdapter = class(TBaseStringAdapter)
  public
    class function EncodingID: string; override;

    function Decode(const AString: AnsiString): String; override;
    function Encode(const AString: String): AnsiString; override;
  end;

implementation

uses
  StrAdapter;

{ TDefaultAdapter }

function TDefaultAdapter.Decode(const AString: AnsiString): String;
begin
  Result := string(AString);
end;

function TDefaultAdapter.Encode(const AString: String): AnsiString;
begin
  Result := AnsiString(AString);
end;

class function TDefaultAdapter.EncodingID: string;
begin
  Result := '';
end;

initialization
  TStringAdapter.RegisterAdapter(TDefaultAdapter);

end.



